/**
 *
 */
import Util;
import OpenApi;
import OpenApiUtil;
import EndpointUtil;

extends OpenApi;


init(config: OpenApi.Config){
  super(config);
  @endpointRule = '';
  
  checkConfig(config);
  @endpoint = getEndpoint('vpcipam', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!Util.empty(endpoint)) {
    return endpoint;
  }
  
  if (!Util.isUnset(endpointMap) && !Util.empty(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return EndpointUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}

model AddIpamPoolCidrRequest {
  cidr?: string(name='Cidr', description='This parameter is required.', example='192.168.1.0/24'),
  clientToken?: string(name='ClientToken', example='123e4567-e89b-12d3-a456-426655440000'),
  dryRun?: boolean(name='DryRun', example='false'),
  ipamPoolId?: string(name='IpamPoolId', description='This parameter is required.', example='ipam-pool-6rcq3tobayc20t****'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hangzhou'),
}

model AddIpamPoolCidrResponseBody = {
  requestId?: string(name='RequestId', example='558BC336-8B88-53B0-B4AD-980EE900AB01'),
}

model AddIpamPoolCidrResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AddIpamPoolCidrResponseBody(name='body'),
}

/**
 * @param request AddIpamPoolCidrRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return AddIpamPoolCidrResponse
 */
async function addIpamPoolCidrWithOptions(request: AddIpamPoolCidrRequest, runtime: Util.RuntimeOptions): AddIpamPoolCidrResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.cidr)) {
    query['Cidr'] = request.cidr;
  }
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!Util.isUnset(request.ipamPoolId)) {
    query['IpamPoolId'] = request.ipamPoolId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'AddIpamPoolCidr',
    version = '2023-02-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request AddIpamPoolCidrRequest
 * @return AddIpamPoolCidrResponse
 */
async function addIpamPoolCidr(request: AddIpamPoolCidrRequest): AddIpamPoolCidrResponse {
  var runtime = new Util.RuntimeOptions{};
  return addIpamPoolCidrWithOptions(request, runtime);
}

model AssociateIpamResourceDiscoveryRequest {
  clientToken?: string(name='ClientToken', example='123e4567-e89b-12d3-a456-426655440000'),
  dryRun?: boolean(name='DryRun', example='false'),
  ipamId?: string(name='IpamId', description='This parameter is required.', example='ipam-ccxbnsbhew0d6t****'),
  ipamResourceDiscoveryId?: string(name='IpamResourceDiscoveryId', description='This parameter is required.', example='ipam-res-disco-jt5f2af2u6nk2z321****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model AssociateIpamResourceDiscoveryResponseBody = {
  requestId?: string(name='RequestId', example='E897D16A-50EB-543F-B002-C5A26AB818FF'),
}

model AssociateIpamResourceDiscoveryResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AssociateIpamResourceDiscoveryResponseBody(name='body'),
}

/**
 * @summary 关联资源发现和IPAM实例。
 *
 * @param request AssociateIpamResourceDiscoveryRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return AssociateIpamResourceDiscoveryResponse
 */
async function associateIpamResourceDiscoveryWithOptions(request: AssociateIpamResourceDiscoveryRequest, runtime: Util.RuntimeOptions): AssociateIpamResourceDiscoveryResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!Util.isUnset(request.ipamId)) {
    query['IpamId'] = request.ipamId;
  }
  if (!Util.isUnset(request.ipamResourceDiscoveryId)) {
    query['IpamResourceDiscoveryId'] = request.ipamResourceDiscoveryId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'AssociateIpamResourceDiscovery',
    version = '2023-02-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 关联资源发现和IPAM实例。
 *
 * @param request AssociateIpamResourceDiscoveryRequest
 * @return AssociateIpamResourceDiscoveryResponse
 */
async function associateIpamResourceDiscovery(request: AssociateIpamResourceDiscoveryRequest): AssociateIpamResourceDiscoveryResponse {
  var runtime = new Util.RuntimeOptions{};
  return associateIpamResourceDiscoveryWithOptions(request, runtime);
}

model ChangeResourceGroupRequest {
  newResourceGroupId?: string(name='NewResourceGroupId', description='This parameter is required.', example='rg-aek3ctkufaw****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hangzhou'),
  resourceId?: string(name='ResourceId', description='This parameter is required.', example='ipam-uq5dcfc2eqhpf4****'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  resourceType?: string(name='ResourceType', description='This parameter is required.', example='ipam'),
}

model ChangeResourceGroupResponseBody = {
  requestId?: string(name='RequestId', example='BB2C39DE-CEB8-595A-981A-F2EFCBE7324E'),
}

model ChangeResourceGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ChangeResourceGroupResponseBody(name='body'),
}

/**
 * @param request ChangeResourceGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ChangeResourceGroupResponse
 */
async function changeResourceGroupWithOptions(request: ChangeResourceGroupRequest, runtime: Util.RuntimeOptions): ChangeResourceGroupResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.newResourceGroupId)) {
    query['NewResourceGroupId'] = request.newResourceGroupId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceId)) {
    query['ResourceId'] = request.resourceId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.resourceType)) {
    query['ResourceType'] = request.resourceType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ChangeResourceGroup',
    version = '2023-02-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ChangeResourceGroupRequest
 * @return ChangeResourceGroupResponse
 */
async function changeResourceGroup(request: ChangeResourceGroupRequest): ChangeResourceGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return changeResourceGroupWithOptions(request, runtime);
}

model CreateIpamRequest {
  clientToken?: string(name='ClientToken', example='123e4567-e89b-12d3-a456-426655440000'),
  dryRun?: boolean(name='DryRun', example='false'),
  ipamDescription?: string(name='IpamDescription', example='This is my first Ipam'),
  ipamName?: string(name='IpamName', example='abc'),
  operatingRegionList?: [ string ](name='OperatingRegionList', description='This parameter is required.'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hangzhou'),
  resourceGroupId?: string(name='ResourceGroupId', example='rg-acfmxazb4ph6aiy****'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  tag?: [ 
    {
      key?: string(name='Key'),
      value?: string(name='Value'),
    }
  ](name='Tag'),
}

model CreateIpamResponseBody = {
  defaultResourceDiscoveryAssociationId?: string(name='DefaultResourceDiscoveryAssociationId'),
  defaultResourceDiscoveryId?: string(name='DefaultResourceDiscoveryId'),
  ipamId?: string(name='IpamId', example='ipam-ccxbnsbhew0d6t****'),
  privateDefaultScopeId?: string(name='PrivateDefaultScopeId', example='ipam-scope-8wiontzmiy6cg0****'),
  publicDefaultScopeId?: string(name='PublicDefaultScopeId', example='ipam-scope-r5c5c7bmym1brc****'),
  requestId?: string(name='RequestId', example='0ED8D006-F706-4D23-88ED-E11ED39DCAC0'),
  resourceDiscoveryAssociationCount?: int32(name='ResourceDiscoveryAssociationCount'),
}

model CreateIpamResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateIpamResponseBody(name='body'),
}

/**
 * @summary 创建IPAM实例。
 *
 * @param request CreateIpamRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateIpamResponse
 */
async function createIpamWithOptions(request: CreateIpamRequest, runtime: Util.RuntimeOptions): CreateIpamResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!Util.isUnset(request.ipamDescription)) {
    query['IpamDescription'] = request.ipamDescription;
  }
  if (!Util.isUnset(request.ipamName)) {
    query['IpamName'] = request.ipamName;
  }
  if (!Util.isUnset(request.operatingRegionList)) {
    query['OperatingRegionList'] = request.operatingRegionList;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.tag)) {
    query['Tag'] = request.tag;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateIpam',
    version = '2023-02-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 创建IPAM实例。
 *
 * @param request CreateIpamRequest
 * @return CreateIpamResponse
 */
async function createIpam(request: CreateIpamRequest): CreateIpamResponse {
  var runtime = new Util.RuntimeOptions{};
  return createIpamWithOptions(request, runtime);
}

model CreateIpamPoolRequest {
  allocationDefaultCidrMask?: int32(name='AllocationDefaultCidrMask', example='28'),
  allocationMaxCidrMask?: int32(name='AllocationMaxCidrMask', example='32'),
  allocationMinCidrMask?: int32(name='AllocationMinCidrMask', example='8'),
  autoImport?: boolean(name='AutoImport'),
  clientToken?: string(name='ClientToken', example='123e4567-e89b-12d3-a456-426655440000'),
  dryRun?: boolean(name='DryRun', example='false'),
  ipVersion?: string(name='IpVersion', example='IPv4'),
  ipamPoolDescription?: string(name='IpamPoolDescription', example='test description'),
  ipamPoolName?: string(name='IpamPoolName', example='abc'),
  ipamScopeId?: string(name='IpamScopeId', description='This parameter is required.', example='ipam-scope-glfmcyldpm8lsy****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  poolRegionId?: string(name='PoolRegionId', example='cn-hangzhou'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hangzhou'),
  resourceGroupId?: string(name='ResourceGroupId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  sourceIpamPoolId?: string(name='SourceIpamPoolId', example='ipam-pool-6rcq3tobayc20t****'),
  tag?: [ 
    {
      key?: string(name='Key'),
      value?: string(name='Value'),
    }
  ](name='Tag'),
}

model CreateIpamPoolResponseBody = {
  ipamPoolId?: string(name='IpamPoolId', example='ipam-pool-6rcq3tobayc20t****'),
  requestId?: string(name='RequestId', example='BB2C39DE-CEB8-595A-981A-F2EFCBE7324E'),
}

model CreateIpamPoolResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateIpamPoolResponseBody(name='body'),
}

/**
 * @param request CreateIpamPoolRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateIpamPoolResponse
 */
async function createIpamPoolWithOptions(request: CreateIpamPoolRequest, runtime: Util.RuntimeOptions): CreateIpamPoolResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.allocationDefaultCidrMask)) {
    query['AllocationDefaultCidrMask'] = request.allocationDefaultCidrMask;
  }
  if (!Util.isUnset(request.allocationMaxCidrMask)) {
    query['AllocationMaxCidrMask'] = request.allocationMaxCidrMask;
  }
  if (!Util.isUnset(request.allocationMinCidrMask)) {
    query['AllocationMinCidrMask'] = request.allocationMinCidrMask;
  }
  if (!Util.isUnset(request.autoImport)) {
    query['AutoImport'] = request.autoImport;
  }
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!Util.isUnset(request.ipVersion)) {
    query['IpVersion'] = request.ipVersion;
  }
  if (!Util.isUnset(request.ipamPoolDescription)) {
    query['IpamPoolDescription'] = request.ipamPoolDescription;
  }
  if (!Util.isUnset(request.ipamPoolName)) {
    query['IpamPoolName'] = request.ipamPoolName;
  }
  if (!Util.isUnset(request.ipamScopeId)) {
    query['IpamScopeId'] = request.ipamScopeId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.poolRegionId)) {
    query['PoolRegionId'] = request.poolRegionId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.sourceIpamPoolId)) {
    query['SourceIpamPoolId'] = request.sourceIpamPoolId;
  }
  if (!Util.isUnset(request.tag)) {
    query['Tag'] = request.tag;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateIpamPool',
    version = '2023-02-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request CreateIpamPoolRequest
 * @return CreateIpamPoolResponse
 */
async function createIpamPool(request: CreateIpamPoolRequest): CreateIpamPoolResponse {
  var runtime = new Util.RuntimeOptions{};
  return createIpamPoolWithOptions(request, runtime);
}

model CreateIpamPoolAllocationRequest {
  cidr?: string(name='Cidr', example='192.168.1.0/24'),
  cidrMask?: int32(name='CidrMask', example='24'),
  clientToken?: string(name='ClientToken', example='123e4567-e89b-12d3-a456-426655440000'),
  dryRun?: boolean(name='DryRun', example='false'),
  ipamPoolAllocationDescription?: string(name='IpamPoolAllocationDescription'),
  ipamPoolAllocationName?: string(name='IpamPoolAllocationName'),
  ipamPoolId?: string(name='IpamPoolId', description='This parameter is required.', example='ipam-pool-6rcq3tobayc20t****'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hangzhou'),
}

model CreateIpamPoolAllocationResponseBody = {
  cidr?: string(name='Cidr', example='192.168.1.0/24'),
  ipamPoolAllocationId?: string(name='IpamPoolAllocationId', example='ipam-pool-alloc-112za33e4****'),
  requestId?: string(name='RequestId', example='CE9CDAE5-341E-5D0B-AC8A-2BAC707D3EB2'),
  sourceCidr?: string(name='SourceCidr', example='192.168.0.0/16'),
}

model CreateIpamPoolAllocationResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateIpamPoolAllocationResponseBody(name='body'),
}

/**
 * @param request CreateIpamPoolAllocationRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateIpamPoolAllocationResponse
 */
async function createIpamPoolAllocationWithOptions(request: CreateIpamPoolAllocationRequest, runtime: Util.RuntimeOptions): CreateIpamPoolAllocationResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.cidr)) {
    query['Cidr'] = request.cidr;
  }
  if (!Util.isUnset(request.cidrMask)) {
    query['CidrMask'] = request.cidrMask;
  }
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!Util.isUnset(request.ipamPoolAllocationDescription)) {
    query['IpamPoolAllocationDescription'] = request.ipamPoolAllocationDescription;
  }
  if (!Util.isUnset(request.ipamPoolAllocationName)) {
    query['IpamPoolAllocationName'] = request.ipamPoolAllocationName;
  }
  if (!Util.isUnset(request.ipamPoolId)) {
    query['IpamPoolId'] = request.ipamPoolId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateIpamPoolAllocation',
    version = '2023-02-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request CreateIpamPoolAllocationRequest
 * @return CreateIpamPoolAllocationResponse
 */
async function createIpamPoolAllocation(request: CreateIpamPoolAllocationRequest): CreateIpamPoolAllocationResponse {
  var runtime = new Util.RuntimeOptions{};
  return createIpamPoolAllocationWithOptions(request, runtime);
}

model CreateIpamResourceDiscoveryRequest {
  clientToken?: string(name='ClientToken', example='123e4567-e89b-12d3-a456-426655440000'),
  dryRun?: boolean(name='DryRun', example='false'),
  ipamResourceDiscoveryDescription?: string(name='IpamResourceDiscoveryDescription', example='description'),
  ipamResourceDiscoveryName?: string(name='IpamResourceDiscoveryName', example='name'),
  operatingRegionList?: [ string ](name='OperatingRegionList', description='This parameter is required.'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hangzhou'),
  resourceGroupId?: string(name='ResourceGroupId', example='rg-aek2sermdd6****'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  tag?: [ 
    {
      key?: string(name='Key', example='FinanceDept'),
      value?: string(name='Value', example='FinanceJoshua'),
    }
  ](name='Tag'),
}

model CreateIpamResourceDiscoveryResponseBody = {
  ipamResourceDiscoveryId?: string(name='IpamResourceDiscoveryId', example='ipam-res-disco-jt5f2af2u6nk2z321****'),
  requestId?: string(name='RequestId', example='BB2C39DE-CEB8-595A-981A-F2EFCBE7324E'),
}

model CreateIpamResourceDiscoveryResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateIpamResourceDiscoveryResponseBody(name='body'),
}

/**
 * @summary 创建自定义类型资源发现。
 *
 * @param request CreateIpamResourceDiscoveryRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateIpamResourceDiscoveryResponse
 */
async function createIpamResourceDiscoveryWithOptions(request: CreateIpamResourceDiscoveryRequest, runtime: Util.RuntimeOptions): CreateIpamResourceDiscoveryResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!Util.isUnset(request.ipamResourceDiscoveryDescription)) {
    query['IpamResourceDiscoveryDescription'] = request.ipamResourceDiscoveryDescription;
  }
  if (!Util.isUnset(request.ipamResourceDiscoveryName)) {
    query['IpamResourceDiscoveryName'] = request.ipamResourceDiscoveryName;
  }
  if (!Util.isUnset(request.operatingRegionList)) {
    query['OperatingRegionList'] = request.operatingRegionList;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.tag)) {
    query['Tag'] = request.tag;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateIpamResourceDiscovery',
    version = '2023-02-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 创建自定义类型资源发现。
 *
 * @param request CreateIpamResourceDiscoveryRequest
 * @return CreateIpamResourceDiscoveryResponse
 */
async function createIpamResourceDiscovery(request: CreateIpamResourceDiscoveryRequest): CreateIpamResourceDiscoveryResponse {
  var runtime = new Util.RuntimeOptions{};
  return createIpamResourceDiscoveryWithOptions(request, runtime);
}

model CreateIpamScopeRequest {
  clientToken?: string(name='ClientToken', example='123e4567-e89b-12d3-a456-426655440000'),
  dryRun?: boolean(name='DryRun', example='false'),
  ipamId?: string(name='IpamId', description='This parameter is required.', example='ipam-ccxbnsbhew0d6t****'),
  ipamScopeDescription?: string(name='IpamScopeDescription', example='test description'),
  ipamScopeName?: string(name='IpamScopeName', example='test'),
  ipamScopeType?: string(name='IpamScopeType', example='private'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hangzhou'),
  resourceGroupId?: string(name='ResourceGroupId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  tag?: [ 
    {
      key?: string(name='Key'),
      value?: string(name='Value'),
    }
  ](name='Tag'),
}

model CreateIpamScopeResponseBody = {
  ipamScopeId?: string(name='IpamScopeId', example='ipam-scope-glfmcyldpm8lsy****'),
  requestId?: string(name='RequestId', example='E897D16A-50EB-543F-B002-C5A26AB818FF'),
}

model CreateIpamScopeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateIpamScopeResponseBody(name='body'),
}

/**
 * @param request CreateIpamScopeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateIpamScopeResponse
 */
async function createIpamScopeWithOptions(request: CreateIpamScopeRequest, runtime: Util.RuntimeOptions): CreateIpamScopeResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!Util.isUnset(request.ipamId)) {
    query['IpamId'] = request.ipamId;
  }
  if (!Util.isUnset(request.ipamScopeDescription)) {
    query['IpamScopeDescription'] = request.ipamScopeDescription;
  }
  if (!Util.isUnset(request.ipamScopeName)) {
    query['IpamScopeName'] = request.ipamScopeName;
  }
  if (!Util.isUnset(request.ipamScopeType)) {
    query['IpamScopeType'] = request.ipamScopeType;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.tag)) {
    query['Tag'] = request.tag;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateIpamScope',
    version = '2023-02-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request CreateIpamScopeRequest
 * @return CreateIpamScopeResponse
 */
async function createIpamScope(request: CreateIpamScopeRequest): CreateIpamScopeResponse {
  var runtime = new Util.RuntimeOptions{};
  return createIpamScopeWithOptions(request, runtime);
}

model DeleteIpamRequest {
  clientToken?: string(name='ClientToken', example='123e4567-e89b-12d3-a456-426655440000'),
  dryRun?: boolean(name='DryRun', example='false'),
  ipamId?: string(name='IpamId', description='This parameter is required.', example='ipam-ccxbnsbhew0d6t****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DeleteIpamResponseBody = {
  requestId?: string(name='RequestId', example='30A20EE2-6223-5D0F-BF49-D7C78F206063'),
}

model DeleteIpamResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteIpamResponseBody(name='body'),
}

/**
 * @param request DeleteIpamRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteIpamResponse
 */
async function deleteIpamWithOptions(request: DeleteIpamRequest, runtime: Util.RuntimeOptions): DeleteIpamResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!Util.isUnset(request.ipamId)) {
    query['IpamId'] = request.ipamId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteIpam',
    version = '2023-02-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request DeleteIpamRequest
 * @return DeleteIpamResponse
 */
async function deleteIpam(request: DeleteIpamRequest): DeleteIpamResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteIpamWithOptions(request, runtime);
}

model DeleteIpamPoolRequest {
  clientToken?: string(name='ClientToken', example='123e4567-e89b-12d3-a456-426655440000'),
  dryRun?: boolean(name='DryRun', example='false'),
  ipamPoolId?: string(name='IpamPoolId', description='This parameter is required.', example='ipam-pool-6rcq3tobayc20t****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DeleteIpamPoolResponseBody = {
  requestId?: string(name='RequestId', example='57B7DCCA-F192-5528-8AF3-2FE1413228C9'),
}

model DeleteIpamPoolResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteIpamPoolResponseBody(name='body'),
}

/**
 * @param request DeleteIpamPoolRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteIpamPoolResponse
 */
async function deleteIpamPoolWithOptions(request: DeleteIpamPoolRequest, runtime: Util.RuntimeOptions): DeleteIpamPoolResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!Util.isUnset(request.ipamPoolId)) {
    query['IpamPoolId'] = request.ipamPoolId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteIpamPool',
    version = '2023-02-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request DeleteIpamPoolRequest
 * @return DeleteIpamPoolResponse
 */
async function deleteIpamPool(request: DeleteIpamPoolRequest): DeleteIpamPoolResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteIpamPoolWithOptions(request, runtime);
}

model DeleteIpamPoolAllocationRequest {
  clientToken?: string(name='ClientToken', example='123e4567-e89b-12d3-a456-426655440000'),
  dryRun?: boolean(name='DryRun', example='false'),
  ipamPoolAllocationId?: string(name='IpamPoolAllocationId', description='This parameter is required.', example='ipam-alloc-c4vhvr3b22mmc6****'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hangzhou'),
}

model DeleteIpamPoolAllocationResponseBody = {
  requestId?: string(name='RequestId', example='B90776C8-F703-51D5-893A-AD1CA699D535'),
}

model DeleteIpamPoolAllocationResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteIpamPoolAllocationResponseBody(name='body'),
}

/**
 * @param request DeleteIpamPoolAllocationRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteIpamPoolAllocationResponse
 */
async function deleteIpamPoolAllocationWithOptions(request: DeleteIpamPoolAllocationRequest, runtime: Util.RuntimeOptions): DeleteIpamPoolAllocationResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!Util.isUnset(request.ipamPoolAllocationId)) {
    query['IpamPoolAllocationId'] = request.ipamPoolAllocationId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteIpamPoolAllocation',
    version = '2023-02-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request DeleteIpamPoolAllocationRequest
 * @return DeleteIpamPoolAllocationResponse
 */
async function deleteIpamPoolAllocation(request: DeleteIpamPoolAllocationRequest): DeleteIpamPoolAllocationResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteIpamPoolAllocationWithOptions(request, runtime);
}

model DeleteIpamPoolCidrRequest {
  cidr?: string(name='Cidr', description='This parameter is required.', example='192.168.1.0/24'),
  clientToken?: string(name='ClientToken', example='123e4567-e89b-12d3-a456-426655440000'),
  dryRun?: boolean(name='DryRun', example='false'),
  ipamPoolId?: string(name='IpamPoolId', description='This parameter is required.', example='ipam-pool-6rcq3tobayc20t****'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hangzhou'),
}

model DeleteIpamPoolCidrResponseBody = {
  requestId?: string(name='RequestId', example='F28A239E-F88D-500E-ADE7-FA5E8CA3A170'),
}

model DeleteIpamPoolCidrResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteIpamPoolCidrResponseBody(name='body'),
}

/**
 * @param request DeleteIpamPoolCidrRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteIpamPoolCidrResponse
 */
async function deleteIpamPoolCidrWithOptions(request: DeleteIpamPoolCidrRequest, runtime: Util.RuntimeOptions): DeleteIpamPoolCidrResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.cidr)) {
    query['Cidr'] = request.cidr;
  }
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!Util.isUnset(request.ipamPoolId)) {
    query['IpamPoolId'] = request.ipamPoolId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteIpamPoolCidr',
    version = '2023-02-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request DeleteIpamPoolCidrRequest
 * @return DeleteIpamPoolCidrResponse
 */
async function deleteIpamPoolCidr(request: DeleteIpamPoolCidrRequest): DeleteIpamPoolCidrResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteIpamPoolCidrWithOptions(request, runtime);
}

model DeleteIpamResourceDiscoveryRequest {
  clientToken?: string(name='ClientToken', example='123e4567-e89b-12d3-a456-426655440000'),
  dryRun?: boolean(name='DryRun', example='false'),
  ipamResourceDiscoveryId?: string(name='IpamResourceDiscoveryId', description='This parameter is required.', example='ipam-res-disco-jt5f2af2u6nk2z321****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DeleteIpamResourceDiscoveryResponseBody = {
  requestId?: string(name='RequestId', example='9F8315CB-560E-5F1E-B069-6E44B440CAF8'),
}

model DeleteIpamResourceDiscoveryResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteIpamResourceDiscoveryResponseBody(name='body'),
}

/**
 * @summary 删除自定义类型的资源发现。
 *
 * @param request DeleteIpamResourceDiscoveryRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteIpamResourceDiscoveryResponse
 */
async function deleteIpamResourceDiscoveryWithOptions(request: DeleteIpamResourceDiscoveryRequest, runtime: Util.RuntimeOptions): DeleteIpamResourceDiscoveryResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!Util.isUnset(request.ipamResourceDiscoveryId)) {
    query['IpamResourceDiscoveryId'] = request.ipamResourceDiscoveryId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteIpamResourceDiscovery',
    version = '2023-02-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 删除自定义类型的资源发现。
 *
 * @param request DeleteIpamResourceDiscoveryRequest
 * @return DeleteIpamResourceDiscoveryResponse
 */
async function deleteIpamResourceDiscovery(request: DeleteIpamResourceDiscoveryRequest): DeleteIpamResourceDiscoveryResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteIpamResourceDiscoveryWithOptions(request, runtime);
}

model DeleteIpamScopeRequest {
  clientToken?: string(name='ClientToken', example='88144bdb-b190-4813-a3f5-66cc86694162'),
  dryRun?: boolean(name='DryRun', example='false'),
  ipamScopeId?: string(name='IpamScopeId', description='This parameter is required.', example='ipam-scope-glfmcyldpm8lsy****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DeleteIpamScopeResponseBody = {
  requestId?: string(name='RequestId', example='9F8315CB-560E-5F1E-B069-6E44B440CAF8'),
}

model DeleteIpamScopeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteIpamScopeResponseBody(name='body'),
}

/**
 * @param request DeleteIpamScopeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteIpamScopeResponse
 */
async function deleteIpamScopeWithOptions(request: DeleteIpamScopeRequest, runtime: Util.RuntimeOptions): DeleteIpamScopeResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!Util.isUnset(request.ipamScopeId)) {
    query['IpamScopeId'] = request.ipamScopeId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteIpamScope',
    version = '2023-02-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request DeleteIpamScopeRequest
 * @return DeleteIpamScopeResponse
 */
async function deleteIpamScope(request: DeleteIpamScopeRequest): DeleteIpamScopeResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteIpamScopeWithOptions(request, runtime);
}

model DissociateIpamResourceDiscoveryRequest {
  clientToken?: string(name='ClientToken', example='123e4567-e89b-12d3-a456-426655440000'),
  dryRun?: boolean(name='DryRun', example='false'),
  ipamId?: string(name='IpamId', description='This parameter is required.', example='ipam-ccxbnsbhew0d6t****'),
  ipamResourceDiscoveryId?: string(name='IpamResourceDiscoveryId', description='This parameter is required.', example='ipam-res-disco-jt5f2af2u6nk2z321****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DissociateIpamResourceDiscoveryResponseBody = {
  requestId?: string(name='RequestId', example='86137597-443F-5B66-B9B6-8514E0C50B8F'),
}

model DissociateIpamResourceDiscoveryResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DissociateIpamResourceDiscoveryResponseBody(name='body'),
}

/**
 * @summary 解关联资源发现和IPAM实例。
 *
 * @param request DissociateIpamResourceDiscoveryRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DissociateIpamResourceDiscoveryResponse
 */
async function dissociateIpamResourceDiscoveryWithOptions(request: DissociateIpamResourceDiscoveryRequest, runtime: Util.RuntimeOptions): DissociateIpamResourceDiscoveryResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!Util.isUnset(request.ipamId)) {
    query['IpamId'] = request.ipamId;
  }
  if (!Util.isUnset(request.ipamResourceDiscoveryId)) {
    query['IpamResourceDiscoveryId'] = request.ipamResourceDiscoveryId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DissociateIpamResourceDiscovery',
    version = '2023-02-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 解关联资源发现和IPAM实例。
 *
 * @param request DissociateIpamResourceDiscoveryRequest
 * @return DissociateIpamResourceDiscoveryResponse
 */
async function dissociateIpamResourceDiscovery(request: DissociateIpamResourceDiscoveryRequest): DissociateIpamResourceDiscoveryResponse {
  var runtime = new Util.RuntimeOptions{};
  return dissociateIpamResourceDiscoveryWithOptions(request, runtime);
}

model GetIpamPoolAllocationRequest {
  ipamPoolAllocationId?: string(name='IpamPoolAllocationId', description='This parameter is required.', example='ipam-pool-alloc-112za33e4****'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hangzhou'),
}

model GetIpamPoolAllocationResponseBody = {
  cidr?: string(name='Cidr', example='192.168.1.0/24'),
  creationTime?: string(name='CreationTime', example='2024-10-15T10:24:19+08:00'),
  ipamPoolAllocationDescription?: string(name='IpamPoolAllocationDescription', example='ipam pool allocation description'),
  ipamPoolAllocationId?: string(name='IpamPoolAllocationId', example='ipam-pool-alloc-112za33e4****'),
  ipamPoolAllocationName?: string(name='IpamPoolAllocationName', example='ipam pool allocation name'),
  ipamPoolId?: string(name='IpamPoolId', example='ipam-pool-6rcq3tobayc20t****'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
  requestId?: string(name='RequestId', example='3748DEFF-68BE-5EED-9937-7C1D0C21BAB4'),
  resourceId?: string(name='ResourceId', example='vpc-bp16qjewdsunr41m1****'),
  resourceOwnerId?: long(name='ResourceOwnerId', example='1616080591216318'),
  resourceRegionId?: string(name='ResourceRegionId', example='cn-hangzhou'),
  resourceType?: string(name='ResourceType', example='VPC'),
  sourceCidr?: string(name='SourceCidr', example='192.168.0.0/16'),
  status?: string(name='Status', example='Created'),
}

model GetIpamPoolAllocationResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetIpamPoolAllocationResponseBody(name='body'),
}

/**
 * @summary 查询指定IPAM地址池CIDR分配的信息
 *
 * @param request GetIpamPoolAllocationRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetIpamPoolAllocationResponse
 */
async function getIpamPoolAllocationWithOptions(request: GetIpamPoolAllocationRequest, runtime: Util.RuntimeOptions): GetIpamPoolAllocationResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetIpamPoolAllocation',
    version = '2023-02-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 查询指定IPAM地址池CIDR分配的信息
 *
 * @param request GetIpamPoolAllocationRequest
 * @return GetIpamPoolAllocationResponse
 */
async function getIpamPoolAllocation(request: GetIpamPoolAllocationRequest): GetIpamPoolAllocationResponse {
  var runtime = new Util.RuntimeOptions{};
  return getIpamPoolAllocationWithOptions(request, runtime);
}

model GetIpamPoolNextAvailableCidrRequest {
  cidrBlock?: string(name='CidrBlock', example='172.68.0.0/26'),
  cidrMask?: int32(name='CidrMask', example='26'),
  clientToken?: string(name='ClientToken', example='123e4567-e89b-12d3-a456-426655440000'),
  ipamPoolId?: string(name='IpamPoolId', description='This parameter is required.', example='ipam-pool-6rcq3tobayc20t****'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hangzhou'),
}

model GetIpamPoolNextAvailableCidrResponseBody = {
  cidrBlock?: string(name='CidrBlock', example='172.68.0.0/26'),
  requestId?: string(name='RequestId', example='29FC6758-9B7C-5CC7-8CBF-4DD846FE7D82'),
}

model GetIpamPoolNextAvailableCidrResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetIpamPoolNextAvailableCidrResponseBody(name='body'),
}

/**
 * @summary 获取地址池可用CIDR。
 *
 * @param request GetIpamPoolNextAvailableCidrRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetIpamPoolNextAvailableCidrResponse
 */
async function getIpamPoolNextAvailableCidrWithOptions(request: GetIpamPoolNextAvailableCidrRequest, runtime: Util.RuntimeOptions): GetIpamPoolNextAvailableCidrResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetIpamPoolNextAvailableCidr',
    version = '2023-02-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取地址池可用CIDR。
 *
 * @param request GetIpamPoolNextAvailableCidrRequest
 * @return GetIpamPoolNextAvailableCidrResponse
 */
async function getIpamPoolNextAvailableCidr(request: GetIpamPoolNextAvailableCidrRequest): GetIpamPoolNextAvailableCidrResponse {
  var runtime = new Util.RuntimeOptions{};
  return getIpamPoolNextAvailableCidrWithOptions(request, runtime);
}

model GetVpcIpamServiceStatusRequest {
  clientToken?: string(name='ClientToken', example='123e4567-e89b-12d3-a456-426655440000'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model GetVpcIpamServiceStatusResponseBody = {
  enabled?: boolean(name='Enabled', example='true'),
  requestId?: string(name='RequestId', example='2FEE9FFF-57EE-5832-BE88-9308352F3B68'),
}

model GetVpcIpamServiceStatusResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetVpcIpamServiceStatusResponseBody(name='body'),
}

/**
 * @summary 查询IPAM功能的开通状态。
 *
 * @param request GetVpcIpamServiceStatusRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetVpcIpamServiceStatusResponse
 */
async function getVpcIpamServiceStatusWithOptions(request: GetVpcIpamServiceStatusRequest, runtime: Util.RuntimeOptions): GetVpcIpamServiceStatusResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetVpcIpamServiceStatus',
    version = '2023-02-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 查询IPAM功能的开通状态。
 *
 * @param request GetVpcIpamServiceStatusRequest
 * @return GetVpcIpamServiceStatusResponse
 */
async function getVpcIpamServiceStatus(request: GetVpcIpamServiceStatusRequest): GetVpcIpamServiceStatusResponse {
  var runtime = new Util.RuntimeOptions{};
  return getVpcIpamServiceStatusWithOptions(request, runtime);
}

model ListIpamDiscoveredResourceRequest {
  ipamResourceDiscoveryId?: string(name='IpamResourceDiscoveryId', description='This parameter is required.', example='ipam-res-disco-jt5f2af2u6nk2z321****'),
  maxResults?: int32(name='MaxResults', example='10'),
  nextToken?: string(name='NextToken', example='FFmyTO70tTpLG6I3FmYAXGKPd****'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hangzhou'),
  resourceRegionId?: string(name='ResourceRegionId', description='This parameter is required.', example='cn-hangzhou'),
  resourceType?: string(name='ResourceType', example='VPC'),
}

model ListIpamDiscoveredResourceResponseBody = {
  count?: int32(name='Count', example='10'),
  ipamDiscoveredResources?: [ 
    {
      aliUid?: long(name='AliUid', example='132193271328****'),
      cidr?: string(name='Cidr', example='192.168.1.0/32'),
      discoveryTime?: string(name='DiscoveryTime', example='2024-01-01 00:00:00'),
      ipUsage?: string(name='IpUsage', example='0'),
      ipamResourceDiscoveryId?: string(name='IpamResourceDiscoveryId', example='ipam-res-disco-jt5f2af2u6nk2z321****'),
      resourceId?: string(name='ResourceId', example='vpc-uf611fp465c7dyb4z****'),
      resourceOwnerId?: long(name='ResourceOwnerId', example='132193271328****'),
      resourceRegionId?: string(name='ResourceRegionId', example='cn-hangzhou'),
      resourceType?: string(name='ResourceType', example='VPC'),
      sourceCidr?: string(name='SourceCidr', example='192.168.1.0/24'),
      vpcId?: string(name='VpcId', example='vpc-uf611fp465c7dyb4z****'),
    }
  ](name='IpamDiscoveredResources'),
  maxResults?: int32(name='MaxResults', example='10'),
  nextToken?: string(name='NextToken', example='FFmyTO70tTpLG6I3FmYAXGKPd****'),
  requestId?: string(name='RequestId', example='3748DEFF-68BE-5EED-9937-7C1D0C21BAB4'),
  totalCount?: long(name='TotalCount', example='1000'),
}

model ListIpamDiscoveredResourceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListIpamDiscoveredResourceResponseBody(name='body'),
}

/**
 * @param request ListIpamDiscoveredResourceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListIpamDiscoveredResourceResponse
 */
async function listIpamDiscoveredResourceWithOptions(request: ListIpamDiscoveredResourceRequest, runtime: Util.RuntimeOptions): ListIpamDiscoveredResourceResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ipamResourceDiscoveryId)) {
    query['IpamResourceDiscoveryId'] = request.ipamResourceDiscoveryId;
  }
  if (!Util.isUnset(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!Util.isUnset(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceRegionId)) {
    query['ResourceRegionId'] = request.resourceRegionId;
  }
  if (!Util.isUnset(request.resourceType)) {
    query['ResourceType'] = request.resourceType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListIpamDiscoveredResource',
    version = '2023-02-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ListIpamDiscoveredResourceRequest
 * @return ListIpamDiscoveredResourceResponse
 */
async function listIpamDiscoveredResource(request: ListIpamDiscoveredResourceRequest): ListIpamDiscoveredResourceResponse {
  var runtime = new Util.RuntimeOptions{};
  return listIpamDiscoveredResourceWithOptions(request, runtime);
}

model ListIpamPoolAllocationsRequest {
  cidr?: string(name='Cidr', example='192.168.1.0/24'),
  ipamPoolAllocationIds?: [ string ](name='IpamPoolAllocationIds'),
  ipamPoolAllocationName?: string(name='IpamPoolAllocationName'),
  ipamPoolId?: string(name='IpamPoolId', description='This parameter is required.', example='ipam-pool-6rcq3tobayc20t****'),
  maxResults?: int32(name='MaxResults', example='10'),
  nextToken?: string(name='NextToken', example='FFmyTO70tTpLG6I3FmYAXGKPd****'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hangzhou'),
}

model ListIpamPoolAllocationsResponseBody = {
  count?: long(name='Count'),
  ipamPoolAllocations?: [ 
    {
      cidr?: string(name='Cidr', example='192.168.1.0/24'),
      creationTime?: string(name='CreationTime', example='2023-05-19T08:59:18Z'),
      ipamPoolAllocationDescription?: string(name='IpamPoolAllocationDescription'),
      ipamPoolAllocationId?: string(name='IpamPoolAllocationId', example='ipam-pool-alloc-112za33e4****'),
      ipamPoolAllocationName?: string(name='IpamPoolAllocationName'),
      ipamPoolId?: string(name='IpamPoolId', example='ipam-pool-6rcq3tobayc20t****'),
      regionId?: string(name='RegionId', example='cn-hangzhou'),
      resourceId?: string(name='ResourceId', example='vpc-bp16qjewdsunr41m1****'),
      resourceOwnerId?: long(name='ResourceOwnerId', example='132193271328****'),
      resourceRegionId?: string(name='ResourceRegionId', example='cn-hangzhou'),
      resourceType?: string(name='ResourceType', example='Custom'),
      sourceCidr?: string(name='SourceCidr', example='192.168.0.0/16'),
      status?: string(name='Status', example='Created'),
    }
  ](name='IpamPoolAllocations'),
  maxResults?: long(name='MaxResults', example='10'),
  nextToken?: string(name='NextToken', example='FFmyTO70tTpLG6I3FmYAXGKPd****'),
  requestId?: string(name='RequestId', example='3748DEFF-68BE-5EED-9937-7C1D0C21BAB4'),
  totalCount?: long(name='TotalCount', example='1000'),
}

model ListIpamPoolAllocationsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListIpamPoolAllocationsResponseBody(name='body'),
}

/**
 * @param request ListIpamPoolAllocationsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListIpamPoolAllocationsResponse
 */
async function listIpamPoolAllocationsWithOptions(request: ListIpamPoolAllocationsRequest, runtime: Util.RuntimeOptions): ListIpamPoolAllocationsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.cidr)) {
    query['Cidr'] = request.cidr;
  }
  if (!Util.isUnset(request.ipamPoolAllocationIds)) {
    query['IpamPoolAllocationIds'] = request.ipamPoolAllocationIds;
  }
  if (!Util.isUnset(request.ipamPoolAllocationName)) {
    query['IpamPoolAllocationName'] = request.ipamPoolAllocationName;
  }
  if (!Util.isUnset(request.ipamPoolId)) {
    query['IpamPoolId'] = request.ipamPoolId;
  }
  if (!Util.isUnset(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!Util.isUnset(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListIpamPoolAllocations',
    version = '2023-02-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ListIpamPoolAllocationsRequest
 * @return ListIpamPoolAllocationsResponse
 */
async function listIpamPoolAllocations(request: ListIpamPoolAllocationsRequest): ListIpamPoolAllocationsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listIpamPoolAllocationsWithOptions(request, runtime);
}

model ListIpamPoolCidrsRequest {
  cidr?: string(name='Cidr', example='192.168.1.0/24'),
  ipamPoolId?: string(name='IpamPoolId', description='This parameter is required.', example='ipam-pool-6rcq3tobayc20t****'),
  maxResults?: int32(name='MaxResults', example='10'),
  nextToken?: string(name='NextToken', example='FFmyTO70tTpLG6I3FmYAXGKPd****'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hangzhou'),
}

model ListIpamPoolCidrsResponseBody = {
  count?: long(name='Count'),
  ipamPoolCidrs?: [ 
    {
      cidr?: string(name='Cidr', example='192.168.1.0/24'),
      ipamPoolId?: string(name='IpamPoolId', example='ipam-pool-6rcq3tobayc20t****'),
      status?: string(name='Status', example='Created'),
    }
  ](name='IpamPoolCidrs'),
  maxResults?: long(name='MaxResults', example='10'),
  nextToken?: string(name='NextToken', example='FFmyTO70tTpLG6I3FmYAXGKPd****'),
  requestId?: string(name='RequestId', example='9E7CCB95-62E0-534D-9B9A-71F27E8B71B1'),
  totalCount?: long(name='TotalCount', example='1000'),
}

model ListIpamPoolCidrsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListIpamPoolCidrsResponseBody(name='body'),
}

/**
 * @param request ListIpamPoolCidrsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListIpamPoolCidrsResponse
 */
async function listIpamPoolCidrsWithOptions(request: ListIpamPoolCidrsRequest, runtime: Util.RuntimeOptions): ListIpamPoolCidrsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.cidr)) {
    query['Cidr'] = request.cidr;
  }
  if (!Util.isUnset(request.ipamPoolId)) {
    query['IpamPoolId'] = request.ipamPoolId;
  }
  if (!Util.isUnset(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!Util.isUnset(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListIpamPoolCidrs',
    version = '2023-02-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ListIpamPoolCidrsRequest
 * @return ListIpamPoolCidrsResponse
 */
async function listIpamPoolCidrs(request: ListIpamPoolCidrsRequest): ListIpamPoolCidrsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listIpamPoolCidrsWithOptions(request, runtime);
}

model ListIpamPoolsRequest {
  ipamPoolIds?: [ string ](name='IpamPoolIds'),
  ipamPoolName?: string(name='IpamPoolName', example='test'),
  ipamScopeId?: string(name='IpamScopeId', example='ipam-scope-glfmcyldpm8lsy****'),
  isShared?: boolean(name='IsShared'),
  maxResults?: int32(name='MaxResults', example='10'),
  nextToken?: string(name='NextToken', example='FFmyTO70tTpLG6I3FmYAXGKPd****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  poolRegionId?: string(name='PoolRegionId', example='cn-hangzhou'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hangzhou'),
  resourceGroupId?: string(name='ResourceGroupId', example='rg-aek2sermdd6****'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  sourceIpamPoolId?: string(name='SourceIpamPoolId', example='ipam-pool-lfnwi4jok1ss0g****'),
  tags?: [ 
    {
      key?: string(name='Key', example='FinanceDept'),
      value?: string(name='Value', example='FinanceJoshua'),
    }
  ](name='Tags'),
}

model ListIpamPoolsResponseBody = {
  count?: long(name='Count'),
  ipamPools?: [ 
    {
      allocationDefaultCidrMask?: int32(name='AllocationDefaultCidrMask', example='28'),
      allocationMaxCidrMask?: int32(name='AllocationMaxCidrMask', example='32'),
      allocationMinCidrMask?: int32(name='AllocationMinCidrMask', example='8'),
      autoImport?: boolean(name='AutoImport'),
      createTime?: string(name='CreateTime', example='2023-04-19T16:49:01Z'),
      hasSubPool?: boolean(name='HasSubPool', example='true'),
      ipVersion?: string(name='IpVersion', example='IPv4'),
      ipamId?: string(name='IpamId', example='ipam-b5mtlx3q7xcnyr****'),
      ipamPoolDescription?: string(name='IpamPoolDescription', example='test description'),
      ipamPoolId?: string(name='IpamPoolId', example='ipam-pool-6rcq3tobayc20t****'),
      ipamPoolName?: string(name='IpamPoolName', example='test'),
      ipamRegionId?: string(name='IpamRegionId', example='cn-hangzhou'),
      ipamScopeId?: string(name='IpamScopeId', example='ipam-scope-glfmcyldpm8lsy****'),
      ipamScopeType?: string(name='IpamScopeType', example='private'),
      isShared?: boolean(name='IsShared'),
      ownerId?: long(name='OwnerId', example='1210123456******'),
      poolDepth?: int32(name='PoolDepth', example='2'),
      poolRegionId?: string(name='PoolRegionId', example='cn-hangzhou'),
      regionId?: string(name='RegionId', example='cn-hangzhou'),
      resourceGroupId?: string(name='ResourceGroupId'),
      sourceIpamPoolId?: string(name='SourceIpamPoolId', example='ipam-pool-lfnwi4jok1ss0g****'),
      status?: string(name='Status', example='Created'),
      tags?: [ 
        {
          key?: string(name='Key', example='FinanceDept'),
          value?: string(name='Value', example='FinanceJoshua'),
        }
      ](name='Tags'),
    }
  ](name='IpamPools'),
  maxResults?: long(name='MaxResults', example='10'),
  nextToken?: string(name='NextToken', example='FFmyTO70tTpLG6I3FmYAXGKPd****'),
  requestId?: string(name='RequestId', example='B54867DE-83DC-56B4-A57E-69A03119D0B1'),
  totalCount?: long(name='TotalCount', example='1000'),
}

model ListIpamPoolsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListIpamPoolsResponseBody(name='body'),
}

/**
 * @param request ListIpamPoolsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListIpamPoolsResponse
 */
async function listIpamPoolsWithOptions(request: ListIpamPoolsRequest, runtime: Util.RuntimeOptions): ListIpamPoolsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ipamPoolIds)) {
    query['IpamPoolIds'] = request.ipamPoolIds;
  }
  if (!Util.isUnset(request.ipamPoolName)) {
    query['IpamPoolName'] = request.ipamPoolName;
  }
  if (!Util.isUnset(request.ipamScopeId)) {
    query['IpamScopeId'] = request.ipamScopeId;
  }
  if (!Util.isUnset(request.isShared)) {
    query['IsShared'] = request.isShared;
  }
  if (!Util.isUnset(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!Util.isUnset(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.poolRegionId)) {
    query['PoolRegionId'] = request.poolRegionId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.sourceIpamPoolId)) {
    query['SourceIpamPoolId'] = request.sourceIpamPoolId;
  }
  if (!Util.isUnset(request.tags)) {
    query['Tags'] = request.tags;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListIpamPools',
    version = '2023-02-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ListIpamPoolsRequest
 * @return ListIpamPoolsResponse
 */
async function listIpamPools(request: ListIpamPoolsRequest): ListIpamPoolsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listIpamPoolsWithOptions(request, runtime);
}

model ListIpamResourceCidrsRequest {
  ipamPoolId?: string(name='IpamPoolId', example='ipam-pool-6rcq3tobayc20t****'),
  ipamScopeId?: string(name='IpamScopeId', example='ipam-scope-glfmcyldpm8lsy****'),
  maxResults?: int32(name='MaxResults', example='10'),
  nextToken?: string(name='NextToken', example='FFmyTO70tTpLG6I3FmYAXGKPd****'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hangzhou'),
  resourceId?: string(name='ResourceId', example='vpc-bp16qjewdsunr41m1****'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  resourceType?: string(name='ResourceType', example='VPC'),
  vpcId?: string(name='VpcId'),
}

model ListIpamResourceCidrsResponseBody = {
  count?: long(name='Count'),
  ipamResourceCidrs?: [ 
    {
      aliUid?: long(name='AliUid', example='132193271328****'),
      cidr?: string(name='Cidr', example='192.168.1.0/32'),
      complianceStatus?: string(name='ComplianceStatus', example='Compliant'),
      ipUsage?: string(name='IpUsage', example='0'),
      ipamAllocationId?: string(name='IpamAllocationId', example='ipam-pool-alloc-112za33e4****'),
      ipamId?: string(name='IpamId', example='ipam-uq5dcfc2eqhpf4****'),
      ipamPoolId?: string(name='IpamPoolId', example='ipam-pool-6rcq3tobayc20t***'),
      ipamScopeId?: string(name='IpamScopeId', example='ipam-scope-glfmcyldpm8lsy****'),
      managementStatus?: string(name='ManagementStatus', example='Managed'),
      overlapDetail?: [ 
        {
          overlapResourceCidr?: string(name='OverlapResourceCidr'),
          overlapResourceId?: string(name='OverlapResourceId'),
          overlapResourceRegion?: string(name='OverlapResourceRegion'),
        }
      ](name='OverlapDetail'),
      overlapStatus?: string(name='OverlapStatus', example='Nonoverlapping'),
      resourceId?: string(name='ResourceId', example='vpc-bp16qjewdsunr41m1****'),
      resourceOwnerId?: long(name='ResourceOwnerId', example='132193271328****'),
      resourceRegionId?: string(name='ResourceRegionId', example='cn-hangzhou'),
      resourceType?: string(name='ResourceType', example='VPC'),
      sourceCidr?: string(name='SourceCidr', example='192.168.1.0/24'),
      status?: string(name='Status', example='Created'),
      vpcId?: string(name='VpcId'),
    }
  ](name='IpamResourceCidrs'),
  maxResults?: long(name='MaxResults', example='10'),
  nextToken?: string(name='NextToken', example='FFmyTO70tTpLG6I3FmYAXGKPd****'),
  requestId?: string(name='RequestId', example='49A9DE56-B68C-5FFC-BC06-509D086F287C'),
  totalCount?: long(name='TotalCount', example='1000'),
}

model ListIpamResourceCidrsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListIpamResourceCidrsResponseBody(name='body'),
}

/**
 * @param request ListIpamResourceCidrsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListIpamResourceCidrsResponse
 */
async function listIpamResourceCidrsWithOptions(request: ListIpamResourceCidrsRequest, runtime: Util.RuntimeOptions): ListIpamResourceCidrsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ipamPoolId)) {
    query['IpamPoolId'] = request.ipamPoolId;
  }
  if (!Util.isUnset(request.ipamScopeId)) {
    query['IpamScopeId'] = request.ipamScopeId;
  }
  if (!Util.isUnset(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!Util.isUnset(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceId)) {
    query['ResourceId'] = request.resourceId;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.resourceType)) {
    query['ResourceType'] = request.resourceType;
  }
  if (!Util.isUnset(request.vpcId)) {
    query['VpcId'] = request.vpcId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListIpamResourceCidrs',
    version = '2023-02-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ListIpamResourceCidrsRequest
 * @return ListIpamResourceCidrsResponse
 */
async function listIpamResourceCidrs(request: ListIpamResourceCidrsRequest): ListIpamResourceCidrsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listIpamResourceCidrsWithOptions(request, runtime);
}

model ListIpamResourceDiscoveriesRequest {
  ipamResourceDiscoveryIds?: [ string ](name='IpamResourceDiscoveryIds'),
  ipamResourceDiscoveryName?: string(name='IpamResourceDiscoveryName', example='test'),
  isShared?: boolean(name='IsShared'),
  maxResults?: int32(name='MaxResults', example='10'),
  nextToken?: string(name='NextToken', example='FFmyTO70tTpLG6I3FmYAXGKPd****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hangzhou'),
  resourceGroupId?: string(name='ResourceGroupId', example='rg-aek2sermdd6****'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  tags?: [ 
    {
      key?: string(name='Key', example='FinanceDept'),
      value?: string(name='Value', example='FinanceJoshua'),
    }
  ](name='Tags'),
  type?: string(name='Type', example='system'),
}

model ListIpamResourceDiscoveriesResponseBody = {
  count?: int32(name='Count', example='1'),
  ipamResourceDiscoveries?: [ 
    {
      createTime?: string(name='CreateTime', example='2022-07-01T02:05:23Z'),
      ipamResourceDiscoveryDescription?: string(name='IpamResourceDiscoveryDescription', example='test description'),
      ipamResourceDiscoveryId?: string(name='IpamResourceDiscoveryId', example='ipam-res-disco-jt5f2af2u6nk2z321****'),
      ipamResourceDiscoveryName?: string(name='IpamResourceDiscoveryName', example='test'),
      ipamResourceDiscoveryStatus?: string(name='IpamResourceDiscoveryStatus', example='Created'),
      operatingRegionList?: [ string ](name='OperatingRegionList'),
      ownerId?: long(name='OwnerId', example='1210123456******'),
      regionId?: string(name='RegionId', example='cn-hangzhou'),
      resourceGroupId?: string(name='ResourceGroupId', example='rg-aek2sermdd6****'),
      shareType?: string(name='ShareType'),
      tags?: [ 
        {
          key?: string(name='Key', example='FinanceDept'),
          value?: string(name='Value', example='FinanceJoshua'),
        }
      ](name='Tags'),
      type?: string(name='Type', example='system'),
    }
  ](name='IpamResourceDiscoveries'),
  maxResults?: int32(name='MaxResults', example='10'),
  nextToken?: string(name='NextToken', example='FFmyTO70tTpLG6I3FmYAXGKPd****'),
  requestId?: string(name='RequestId', example='86137597-443F-5B66-B9B6-8514E0C50B8F'),
  totalCount?: long(name='TotalCount', example='1'),
}

model ListIpamResourceDiscoveriesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListIpamResourceDiscoveriesResponseBody(name='body'),
}

/**
 * @summary 查询ipam资源发现实例
 *
 * @param request ListIpamResourceDiscoveriesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListIpamResourceDiscoveriesResponse
 */
async function listIpamResourceDiscoveriesWithOptions(request: ListIpamResourceDiscoveriesRequest, runtime: Util.RuntimeOptions): ListIpamResourceDiscoveriesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ipamResourceDiscoveryIds)) {
    query['IpamResourceDiscoveryIds'] = request.ipamResourceDiscoveryIds;
  }
  if (!Util.isUnset(request.ipamResourceDiscoveryName)) {
    query['IpamResourceDiscoveryName'] = request.ipamResourceDiscoveryName;
  }
  if (!Util.isUnset(request.isShared)) {
    query['IsShared'] = request.isShared;
  }
  if (!Util.isUnset(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!Util.isUnset(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.tags)) {
    query['Tags'] = request.tags;
  }
  if (!Util.isUnset(request.type)) {
    query['Type'] = request.type;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListIpamResourceDiscoveries',
    version = '2023-02-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 查询ipam资源发现实例
 *
 * @param request ListIpamResourceDiscoveriesRequest
 * @return ListIpamResourceDiscoveriesResponse
 */
async function listIpamResourceDiscoveries(request: ListIpamResourceDiscoveriesRequest): ListIpamResourceDiscoveriesResponse {
  var runtime = new Util.RuntimeOptions{};
  return listIpamResourceDiscoveriesWithOptions(request, runtime);
}

model ListIpamResourceDiscoveryAssociationsRequest {
  ipamId?: string(name='IpamId', example='ipam-ccxbnsbhew0d6t****'),
  ipamResourceDiscoveryId?: string(name='IpamResourceDiscoveryId', example='ipam-res-disco-jt5f2af2u6nk2z321****'),
  maxResults?: int32(name='MaxResults', example='10'),
  nextToken?: string(name='NextToken', example='FFmyTO70tTpLG6I3FmYAXGKPd****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model ListIpamResourceDiscoveryAssociationsResponseBody = {
  count?: int32(name='Count', example='10'),
  ipamResourceDiscoveryAssociations?: [ 
    {
      ipamId?: string(name='IpamId', example='ipam-ccxbnsbhew0d6t****'),
      ipamResourceDiscoveryId?: string(name='IpamResourceDiscoveryId', example='ipam-res-disco-jt5f2af2u6nk2z321****'),
      ipamResourceDiscoveryOwnerId?: string(name='IpamResourceDiscoveryOwnerId', example='1210123456******'),
      ipamResourceDiscoveryStatus?: string(name='IpamResourceDiscoveryStatus', example='Created'),
      ipamResourceDiscoveryType?: string(name='IpamResourceDiscoveryType', example='custom'),
      status?: string(name='Status', example='Created'),
    }
  ](name='IpamResourceDiscoveryAssociations'),
  maxResults?: int32(name='MaxResults', example='10'),
  nextToken?: string(name='NextToken', example='FFmyTO70tTpLG6I3FmYAXGKPd****'),
  requestId?: string(name='RequestId', example='F28A239E-F88D-500E-ADE7-FA5E8CA3A170'),
  totalCount?: long(name='TotalCount', example='20'),
}

model ListIpamResourceDiscoveryAssociationsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListIpamResourceDiscoveryAssociationsResponseBody(name='body'),
}

/**
 * @summary 查看资源发现和IPAM的关联关系。
 *
 * @param request ListIpamResourceDiscoveryAssociationsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListIpamResourceDiscoveryAssociationsResponse
 */
async function listIpamResourceDiscoveryAssociationsWithOptions(request: ListIpamResourceDiscoveryAssociationsRequest, runtime: Util.RuntimeOptions): ListIpamResourceDiscoveryAssociationsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ipamId)) {
    query['IpamId'] = request.ipamId;
  }
  if (!Util.isUnset(request.ipamResourceDiscoveryId)) {
    query['IpamResourceDiscoveryId'] = request.ipamResourceDiscoveryId;
  }
  if (!Util.isUnset(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!Util.isUnset(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListIpamResourceDiscoveryAssociations',
    version = '2023-02-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 查看资源发现和IPAM的关联关系。
 *
 * @param request ListIpamResourceDiscoveryAssociationsRequest
 * @return ListIpamResourceDiscoveryAssociationsResponse
 */
async function listIpamResourceDiscoveryAssociations(request: ListIpamResourceDiscoveryAssociationsRequest): ListIpamResourceDiscoveryAssociationsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listIpamResourceDiscoveryAssociationsWithOptions(request, runtime);
}

model ListIpamScopesRequest {
  ipamId?: string(name='IpamId', example='ipam-ccxbnsbhew0d6t****'),
  ipamScopeIds?: [ string ](name='IpamScopeIds'),
  ipamScopeName?: string(name='IpamScopeName', example='test'),
  ipamScopeType?: string(name='IpamScopeType', example='private'),
  maxResults?: long(name='MaxResults', example='10'),
  nextToken?: string(name='NextToken', example='FFmyTO70tTpLG6I3FmYAXGKPd****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hangzhou'),
  resourceGroupId?: string(name='ResourceGroupId', example='rg-aek2sermdd6****'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  tags?: [ 
    {
      key?: string(name='Key', example='FinanceDept'),
      value?: string(name='Value', example='FinanceJoshua'),
    }
  ](name='Tags'),
}

model ListIpamScopesResponseBody = {
  count?: long(name='Count'),
  ipamScopes?: [ 
    {
      createTime?: string(name='CreateTime', example='2022-04-18T03:12:37Z'),
      ipamId?: string(name='IpamId', example='ipam-ccxbnsbhew0d6t****'),
      ipamScopeDescription?: string(name='IpamScopeDescription', example='test description'),
      ipamScopeId?: string(name='IpamScopeId', example='ipam-scope-glfmcyldpm8lsy****'),
      ipamScopeName?: string(name='IpamScopeName', example='test'),
      ipamScopeType?: string(name='IpamScopeType', example='private'),
      isDefault?: boolean(name='IsDefault', example='true'),
      ownerId?: long(name='OwnerId', example='1210123456******'),
      poolCount?: int32(name='PoolCount', example='2'),
      regionId?: string(name='RegionId', example='cn-hangzhou'),
      resourceGroupId?: string(name='ResourceGroupId'),
      status?: string(name='Status', example='Created'),
      tags?: [ 
        {
          key?: string(name='Key', example='FinanceDept'),
          value?: string(name='Value', example='FinanceDept'),
        }
      ](name='Tags'),
    }
  ](name='IpamScopes'),
  maxResults?: long(name='MaxResults', example='10'),
  nextToken?: string(name='NextToken', example='FFmyTO70tTpLG6I3FmYAXGKPd****'),
  requestId?: string(name='RequestId', example='8859C501-97E7-53D4-B94B-2A9E16003B22'),
  totalCount?: long(name='TotalCount', example='1000'),
}

model ListIpamScopesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListIpamScopesResponseBody(name='body'),
}

/**
 * @param request ListIpamScopesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListIpamScopesResponse
 */
async function listIpamScopesWithOptions(request: ListIpamScopesRequest, runtime: Util.RuntimeOptions): ListIpamScopesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ipamId)) {
    query['IpamId'] = request.ipamId;
  }
  if (!Util.isUnset(request.ipamScopeIds)) {
    query['IpamScopeIds'] = request.ipamScopeIds;
  }
  if (!Util.isUnset(request.ipamScopeName)) {
    query['IpamScopeName'] = request.ipamScopeName;
  }
  if (!Util.isUnset(request.ipamScopeType)) {
    query['IpamScopeType'] = request.ipamScopeType;
  }
  if (!Util.isUnset(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!Util.isUnset(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.tags)) {
    query['Tags'] = request.tags;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListIpamScopes',
    version = '2023-02-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ListIpamScopesRequest
 * @return ListIpamScopesResponse
 */
async function listIpamScopes(request: ListIpamScopesRequest): ListIpamScopesResponse {
  var runtime = new Util.RuntimeOptions{};
  return listIpamScopesWithOptions(request, runtime);
}

model ListIpamsRequest {
  ipamIds?: [ string ](name='IpamIds', description='The IDs of IPAMs. Valid values of N: 1 to 100. A maximum of 100 IPAMs can be queried at a time.'),
  ipamName?: string(name='IpamName', description='The name of the IPAM.

It must be 1 to 128 characters in length and cannot start with `http://` or `https://`.', example='test'),
  maxResults?: long(name='MaxResults', description='The number of entries per page. Valid values: **1** to **100**. Default value: **10**.', example='10'),
  nextToken?: string(name='NextToken', description='The pagination token that is used in the next request to retrieve a new page of results. Valid values:

*   You do not need to specify this parameter for the first request.
*   You must specify the token that is obtained from the previous query as the value of NextToken.', example='FFmyTO70tTpLG6I3FmYAXGKPd****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', description='The ID of the region where the IPAM pool is hosted. You can call the [DescribeRegions](https://help.aliyun.com/document_detail/36063.html) operation to query the most recent region list.

This parameter is required.', example='cn-hangzhou'),
  resourceGroupId?: string(name='ResourceGroupId', description='The resource group ID of the IPAM.', example='rg-aek2sermdd6****'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  tags?: [ 
    {
      key?: string(name='Key', description='The tag key. You can specify at most 20 tag keys. The tag key cannot be an empty string.

The tag key can be up to 64 characters in length and can contain letters, digits, periods (.), underscores (_), and hyphens (-). The tag key must start with a letter but cannot start with `aliyun` or `acs:`. The tag key cannot contain `http://` or `https://`.', example='FinanceDept'),
      value?: string(name='Value', description='The tag value. You can specify at most 20 tag values. The tag value can be an empty string.

The tag value can be up to 128 characters in length. It must start with a letter and can contain digits, periods (.), underscores (_), and hyphens (-). It cannot start with `aliyun` or `acs:`, and cannot contain `http://` or `https://`.', example='FinanceJoshua'),
    }
  ](name='Tags', description='The tag information.'),
}

model ListIpamsResponseBody = {
  count?: long(name='Count', example='10'),
  ipams?: [ 
    {
      createTime?: string(name='CreateTime', description='The time when the IPAM was created.', example='2022-07-01T02:05:23Z'),
      defaultResourceDiscoveryAssociationId?: string(name='DefaultResourceDiscoveryAssociationId', example='ipam-res-disco-assoc-jt5fac8twugdbbgip****'),
      defaultResourceDiscoveryId?: string(name='DefaultResourceDiscoveryId', example='ipam-res-disco-jt5f2af2u6nk2z321****'),
      ipamDescription?: string(name='IpamDescription', description='The description of the IPAM.', example='test description'),
      ipamId?: string(name='IpamId', description='The ID of the IPAM.', example='ipam-ccxbnsbhew0d6t****'),
      ipamName?: string(name='IpamName', description='The name of the IPAM.', example='test'),
      ipamStatus?: string(name='IpamStatus', description='The status of the IPAM. Valid values:

*   **Creating**
*   **Created**
*   **Deleting**
*   **Deleted**', example='Created'),
      operatingRegionList?: [ string ](name='OperatingRegionList', description='The effective regions of the IPAM.'),
      ownerId?: long(name='OwnerId', description='The Alibaba Cloud account that owns the IPAM.', example='1210123456******'),
      privateDefaultScopeId?: string(name='PrivateDefaultScopeId', description='The default private scope created by the system after the IPAM is created.', example='ipam-scope-okoerbco6unqfr****'),
      publicDefaultScopeId?: string(name='PublicDefaultScopeId', description='The default public scope created by the system after the IPAM is created.', example='ipam-scope-ovb76p1g1m19dr****'),
      regionId?: string(name='RegionId', description='The region ID of the IPAM.', example='cn-hangzhou'),
      resourceDiscoveryAssociationCount?: int32(name='ResourceDiscoveryAssociationCount', example='1'),
      resourceGroupId?: string(name='ResourceGroupId', description='The resource group ID of the IPAM.', example='rg-aek2dbprgpt****'),
      scopeCount?: int32(name='ScopeCount', description='The number of IPAM scopes. Value: **2 to 5**.', example='2'),
      tags?: [ 
        {
          key?: string(name='Key', description='The tag key.', example='FinanceDept'),
          value?: string(name='Value', description='The tag value.', example='FinanceJoshua'),
        }
      ](name='Tags', description='The tag list.'),
    }
  ](name='Ipams', description='The IPAMs.'),
  maxResults?: long(name='MaxResults', description='The number of entries per page. Valid values: 1 to 100. Default value: 10.', example='20'),
  nextToken?: string(name='NextToken', description='The pagination token that is used in the next request to retrieve a new page of results. Valid values:

*   If **NextToken** is empty, no next page exists.
*   If a value of **NextToken** is returned, the value indicates the token that is used for the next query.', example='FFmyTO70tTpLG6I3FmYAXGKPd****'),
  requestId?: string(name='RequestId', description='The request ID.', example='23CA0A0B-B0F5-5495-B355-7D9A9203A46B'),
  totalCount?: long(name='TotalCount', description='The number of entries.', example='10'),
}

model ListIpamsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListIpamsResponseBody(name='body'),
}

/**
 * @summary Queries IP Address Managers (IPAMs).
 *
 * @param request ListIpamsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListIpamsResponse
 */
async function listIpamsWithOptions(request: ListIpamsRequest, runtime: Util.RuntimeOptions): ListIpamsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ipamIds)) {
    query['IpamIds'] = request.ipamIds;
  }
  if (!Util.isUnset(request.ipamName)) {
    query['IpamName'] = request.ipamName;
  }
  if (!Util.isUnset(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!Util.isUnset(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.tags)) {
    query['Tags'] = request.tags;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListIpams',
    version = '2023-02-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries IP Address Managers (IPAMs).
 *
 * @param request ListIpamsRequest
 * @return ListIpamsResponse
 */
async function listIpams(request: ListIpamsRequest): ListIpamsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listIpamsWithOptions(request, runtime);
}

model ListTagResourcesRequest {
  maxResults?: int32(name='MaxResults', example='20'),
  nextToken?: string(name='NextToken', example='FFmyTO70tTpLG6I3FmYAXGKPd****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hangzhou'),
  resourceId?: [ string ](name='ResourceId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  resourceType?: string(name='ResourceType', description='This parameter is required.', example='IPAM'),
  tag?: [ 
    {
      key?: string(name='Key', example='FinanceDept'),
      value?: string(name='Value', example='FinanceJoshua'),
    }
  ](name='Tag'),
}

model ListTagResourcesResponseBody = {
  nextToken?: string(name='NextToken', example='FFmyTO70tTpLG6I3FmYAXGKPd****'),
  requestId?: string(name='RequestId', example='672053AB-90C9-5693-AB96-458F137A5ED6'),
  tagResources?: [ 
    {
      resourceId?: string(name='ResourceId', example='ipam-uq5dcfc2eqhpf4****'),
      resourceType?: string(name='ResourceType', example='IPAM'),
      tagKey?: string(name='TagKey', example='FinanceDept'),
      tagValue?: string(name='TagValue', example='FinanceJoshua'),
    }
  ](name='TagResources'),
}

model ListTagResourcesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListTagResourcesResponseBody(name='body'),
}

/**
 * @summary 查询资源标签列表
 *
 * @param request ListTagResourcesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListTagResourcesResponse
 */
async function listTagResourcesWithOptions(request: ListTagResourcesRequest, runtime: Util.RuntimeOptions): ListTagResourcesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!Util.isUnset(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceId)) {
    query['ResourceId'] = request.resourceId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.resourceType)) {
    query['ResourceType'] = request.resourceType;
  }
  if (!Util.isUnset(request.tag)) {
    query['Tag'] = request.tag;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListTagResources',
    version = '2023-02-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 查询资源标签列表
 *
 * @param request ListTagResourcesRequest
 * @return ListTagResourcesResponse
 */
async function listTagResources(request: ListTagResourcesRequest): ListTagResourcesResponse {
  var runtime = new Util.RuntimeOptions{};
  return listTagResourcesWithOptions(request, runtime);
}

model OpenVpcIpamServiceRequest {
  clientToken?: string(name='ClientToken', example='123e4567-e89b-12d3-a456-426655440000'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model OpenVpcIpamServiceResponseBody = {
  code?: string(name='Code', example='200'),
  message?: string(name='Message', example='successful'),
  requestId?: string(name='RequestId', example='3F814C37-B032-5477-AF5A-2925D0593CD4'),
}

model OpenVpcIpamServiceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: OpenVpcIpamServiceResponseBody(name='body'),
}

/**
 * @summary 开通IPAM功能。
 *
 * @param request OpenVpcIpamServiceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return OpenVpcIpamServiceResponse
 */
async function openVpcIpamServiceWithOptions(request: OpenVpcIpamServiceRequest, runtime: Util.RuntimeOptions): OpenVpcIpamServiceResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'OpenVpcIpamService',
    version = '2023-02-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 开通IPAM功能。
 *
 * @param request OpenVpcIpamServiceRequest
 * @return OpenVpcIpamServiceResponse
 */
async function openVpcIpamService(request: OpenVpcIpamServiceRequest): OpenVpcIpamServiceResponse {
  var runtime = new Util.RuntimeOptions{};
  return openVpcIpamServiceWithOptions(request, runtime);
}

model TagResourcesRequest {
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-beijing'),
  resourceId?: [ string ](name='ResourceId', description='This parameter is required.'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  resourceType?: string(name='ResourceType', description='This parameter is required.', example='IPAM'),
  tag?: [ 
    {
      key?: string(name='Key', example='FinanceDept'),
      value?: string(name='Value', example='FinanceJoshua'),
    }
  ](name='Tag', description='This parameter is required.'),
}

model TagResourcesResponseBody = {
  requestId?: string(name='RequestId', example='BF872550-9700-52FD-839C-4D3F05543FA8'),
}

model TagResourcesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: TagResourcesResponseBody(name='body'),
}

/**
 * @summary 为资源实例绑定资源标签
 *
 * @param request TagResourcesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return TagResourcesResponse
 */
async function tagResourcesWithOptions(request: TagResourcesRequest, runtime: Util.RuntimeOptions): TagResourcesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceId)) {
    query['ResourceId'] = request.resourceId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.resourceType)) {
    query['ResourceType'] = request.resourceType;
  }
  if (!Util.isUnset(request.tag)) {
    query['Tag'] = request.tag;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'TagResources',
    version = '2023-02-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 为资源实例绑定资源标签
 *
 * @param request TagResourcesRequest
 * @return TagResourcesResponse
 */
async function tagResources(request: TagResourcesRequest): TagResourcesResponse {
  var runtime = new Util.RuntimeOptions{};
  return tagResourcesWithOptions(request, runtime);
}

model UntagResourcesRequest {
  all?: boolean(name='All', example='false'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hangzhou'),
  resourceId?: [ string ](name='ResourceId', description='This parameter is required.'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  resourceType?: string(name='ResourceType', description='This parameter is required.', example='IPAM'),
  tagKey?: [ string ](name='TagKey'),
}

model UntagResourcesResponseBody = {
  requestId?: string(name='RequestId', example='44C884BD-2D56-5637-A523-1FA920A01E7D'),
}

model UntagResourcesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UntagResourcesResponseBody(name='body'),
}

/**
 * @summary 为资源解绑资源标签
 *
 * @param request UntagResourcesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UntagResourcesResponse
 */
async function untagResourcesWithOptions(request: UntagResourcesRequest, runtime: Util.RuntimeOptions): UntagResourcesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.all)) {
    query['All'] = request.all;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceId)) {
    query['ResourceId'] = request.resourceId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.resourceType)) {
    query['ResourceType'] = request.resourceType;
  }
  if (!Util.isUnset(request.tagKey)) {
    query['TagKey'] = request.tagKey;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UntagResources',
    version = '2023-02-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 为资源解绑资源标签
 *
 * @param request UntagResourcesRequest
 * @return UntagResourcesResponse
 */
async function untagResources(request: UntagResourcesRequest): UntagResourcesResponse {
  var runtime = new Util.RuntimeOptions{};
  return untagResourcesWithOptions(request, runtime);
}

model UpdateIpamRequest {
  addOperatingRegion?: [ string ](name='AddOperatingRegion'),
  clientToken?: string(name='ClientToken', example='123e4567-e89b-12d3-a456-426655440000'),
  dryRun?: boolean(name='DryRun', example='false'),
  ipamDescription?: string(name='IpamDescription', example='test description'),
  ipamId?: string(name='IpamId', description='This parameter is required.', example='ipam-ccxbnsbhew0d6t****'),
  ipamName?: string(name='IpamName', example='test'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hangzhou'),
  removeOperatingRegion?: [ string ](name='RemoveOperatingRegion'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model UpdateIpamResponseBody = {
  requestId?: string(name='RequestId', example='F4650E33-895C-53F0-9CD5-D1338F322DE8'),
}

model UpdateIpamResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateIpamResponseBody(name='body'),
}

/**
 * @summary 更新ipam
 *
 * @param request UpdateIpamRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateIpamResponse
 */
async function updateIpamWithOptions(request: UpdateIpamRequest, runtime: Util.RuntimeOptions): UpdateIpamResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.addOperatingRegion)) {
    query['AddOperatingRegion'] = request.addOperatingRegion;
  }
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!Util.isUnset(request.ipamDescription)) {
    query['IpamDescription'] = request.ipamDescription;
  }
  if (!Util.isUnset(request.ipamId)) {
    query['IpamId'] = request.ipamId;
  }
  if (!Util.isUnset(request.ipamName)) {
    query['IpamName'] = request.ipamName;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.removeOperatingRegion)) {
    query['RemoveOperatingRegion'] = request.removeOperatingRegion;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateIpam',
    version = '2023-02-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 更新ipam
 *
 * @param request UpdateIpamRequest
 * @return UpdateIpamResponse
 */
async function updateIpam(request: UpdateIpamRequest): UpdateIpamResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateIpamWithOptions(request, runtime);
}

model UpdateIpamPoolRequest {
  allocationDefaultCidrMask?: int32(name='AllocationDefaultCidrMask', example='28'),
  allocationMaxCidrMask?: int32(name='AllocationMaxCidrMask', example='32'),
  allocationMinCidrMask?: int32(name='AllocationMinCidrMask', example='8'),
  autoImport?: boolean(name='AutoImport'),
  clearAllocationDefaultCidrMask?: boolean(name='ClearAllocationDefaultCidrMask', example='true'),
  clientToken?: string(name='ClientToken', example='123e4567-e89b-12d3-a456-426655440000'),
  dryRun?: boolean(name='DryRun', example='false'),
  ipamPoolDescription?: string(name='IpamPoolDescription', example='test description'),
  ipamPoolId?: string(name='IpamPoolId', description='This parameter is required.', example='ipam-pool-6rcq3tobayc20t****'),
  ipamPoolName?: string(name='IpamPoolName', example='test'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model UpdateIpamPoolResponseBody = {
  requestId?: string(name='RequestId', example='9DED57B9-7654-5B6D-93F7-BCA5839FEE38'),
}

model UpdateIpamPoolResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateIpamPoolResponseBody(name='body'),
}

/**
 * @param request UpdateIpamPoolRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateIpamPoolResponse
 */
async function updateIpamPoolWithOptions(request: UpdateIpamPoolRequest, runtime: Util.RuntimeOptions): UpdateIpamPoolResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.allocationDefaultCidrMask)) {
    query['AllocationDefaultCidrMask'] = request.allocationDefaultCidrMask;
  }
  if (!Util.isUnset(request.allocationMaxCidrMask)) {
    query['AllocationMaxCidrMask'] = request.allocationMaxCidrMask;
  }
  if (!Util.isUnset(request.allocationMinCidrMask)) {
    query['AllocationMinCidrMask'] = request.allocationMinCidrMask;
  }
  if (!Util.isUnset(request.autoImport)) {
    query['AutoImport'] = request.autoImport;
  }
  if (!Util.isUnset(request.clearAllocationDefaultCidrMask)) {
    query['ClearAllocationDefaultCidrMask'] = request.clearAllocationDefaultCidrMask;
  }
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!Util.isUnset(request.ipamPoolDescription)) {
    query['IpamPoolDescription'] = request.ipamPoolDescription;
  }
  if (!Util.isUnset(request.ipamPoolId)) {
    query['IpamPoolId'] = request.ipamPoolId;
  }
  if (!Util.isUnset(request.ipamPoolName)) {
    query['IpamPoolName'] = request.ipamPoolName;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateIpamPool',
    version = '2023-02-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request UpdateIpamPoolRequest
 * @return UpdateIpamPoolResponse
 */
async function updateIpamPool(request: UpdateIpamPoolRequest): UpdateIpamPoolResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateIpamPoolWithOptions(request, runtime);
}

model UpdateIpamPoolAllocationRequest {
  clientToken?: string(name='ClientToken', example='123e4567-e89b-12d3-a456-426655440000'),
  dryRun?: boolean(name='DryRun', example='false'),
  ipamPoolAllocationDescription?: string(name='IpamPoolAllocationDescription', example='test description'),
  ipamPoolAllocationId?: string(name='IpamPoolAllocationId', description='This parameter is required.', example='ipam-pool-alloc-112za33e4****'),
  ipamPoolAllocationName?: string(name='IpamPoolAllocationName', example='test name'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hangzhou'),
}

model UpdateIpamPoolAllocationResponseBody = {
  requestId?: string(name='RequestId', example='F4650E33-895C-53F0-9CD5-D1338F322DE8'),
}

model UpdateIpamPoolAllocationResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateIpamPoolAllocationResponseBody(name='body'),
}

/**
 * @summary 更新IPAM地址池分配信息
 *
 * @param request UpdateIpamPoolAllocationRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateIpamPoolAllocationResponse
 */
async function updateIpamPoolAllocationWithOptions(request: UpdateIpamPoolAllocationRequest, runtime: Util.RuntimeOptions): UpdateIpamPoolAllocationResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!Util.isUnset(request.ipamPoolAllocationDescription)) {
    query['IpamPoolAllocationDescription'] = request.ipamPoolAllocationDescription;
  }
  if (!Util.isUnset(request.ipamPoolAllocationId)) {
    query['IpamPoolAllocationId'] = request.ipamPoolAllocationId;
  }
  if (!Util.isUnset(request.ipamPoolAllocationName)) {
    query['IpamPoolAllocationName'] = request.ipamPoolAllocationName;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateIpamPoolAllocation',
    version = '2023-02-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 更新IPAM地址池分配信息
 *
 * @param request UpdateIpamPoolAllocationRequest
 * @return UpdateIpamPoolAllocationResponse
 */
async function updateIpamPoolAllocation(request: UpdateIpamPoolAllocationRequest): UpdateIpamPoolAllocationResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateIpamPoolAllocationWithOptions(request, runtime);
}

model UpdateIpamResourceDiscoveryRequest {
  addOperatingRegion?: [ string ](name='AddOperatingRegion'),
  clientToken?: string(name='ClientToken', example='123e4567-e89b-12d3-a456-426655440000'),
  dryRun?: boolean(name='DryRun', example='false'),
  ipamResourceDiscoveryDescription?: string(name='IpamResourceDiscoveryDescription', example='test description'),
  ipamResourceDiscoveryId?: string(name='IpamResourceDiscoveryId', description='This parameter is required.', example='ipam-res-disco-jt5f2af2u6nk2z321****'),
  ipamResourceDiscoveryName?: string(name='IpamResourceDiscoveryName', example='test'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hangzhou'),
  removeOperatingRegion?: [ string ](name='RemoveOperatingRegion'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model UpdateIpamResourceDiscoveryResponseBody = {
  requestId?: string(name='RequestId', example='BB2C39DE-CEB8-595A-981A-F2EFCBE7324E'),
}

model UpdateIpamResourceDiscoveryResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateIpamResourceDiscoveryResponseBody(name='body'),
}

/**
 * @summary 更新自定义类型资源发现。
 *
 * @param request UpdateIpamResourceDiscoveryRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateIpamResourceDiscoveryResponse
 */
async function updateIpamResourceDiscoveryWithOptions(request: UpdateIpamResourceDiscoveryRequest, runtime: Util.RuntimeOptions): UpdateIpamResourceDiscoveryResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.addOperatingRegion)) {
    query['AddOperatingRegion'] = request.addOperatingRegion;
  }
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!Util.isUnset(request.ipamResourceDiscoveryDescription)) {
    query['IpamResourceDiscoveryDescription'] = request.ipamResourceDiscoveryDescription;
  }
  if (!Util.isUnset(request.ipamResourceDiscoveryId)) {
    query['IpamResourceDiscoveryId'] = request.ipamResourceDiscoveryId;
  }
  if (!Util.isUnset(request.ipamResourceDiscoveryName)) {
    query['IpamResourceDiscoveryName'] = request.ipamResourceDiscoveryName;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.removeOperatingRegion)) {
    query['RemoveOperatingRegion'] = request.removeOperatingRegion;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateIpamResourceDiscovery',
    version = '2023-02-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 更新自定义类型资源发现。
 *
 * @param request UpdateIpamResourceDiscoveryRequest
 * @return UpdateIpamResourceDiscoveryResponse
 */
async function updateIpamResourceDiscovery(request: UpdateIpamResourceDiscoveryRequest): UpdateIpamResourceDiscoveryResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateIpamResourceDiscoveryWithOptions(request, runtime);
}

model UpdateIpamScopeRequest {
  clientToken?: string(name='ClientToken', example='123e4567-e89b-12d3-a456-426655440000'),
  dryRun?: boolean(name='DryRun', example='false'),
  ipamScopeDescription?: string(name='IpamScopeDescription', example='test description'),
  ipamScopeId?: string(name='IpamScopeId', description='This parameter is required.', example='ipam-scope-glfmcyldpm8lsy****'),
  ipamScopeName?: string(name='IpamScopeName', example='test'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model UpdateIpamScopeResponseBody = {
  requestId?: string(name='RequestId', example='BA8054F5-852A-570A-ACFF-BCA63E0B02D5'),
}

model UpdateIpamScopeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateIpamScopeResponseBody(name='body'),
}

/**
 * @param request UpdateIpamScopeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateIpamScopeResponse
 */
async function updateIpamScopeWithOptions(request: UpdateIpamScopeRequest, runtime: Util.RuntimeOptions): UpdateIpamScopeResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!Util.isUnset(request.ipamScopeDescription)) {
    query['IpamScopeDescription'] = request.ipamScopeDescription;
  }
  if (!Util.isUnset(request.ipamScopeId)) {
    query['IpamScopeId'] = request.ipamScopeId;
  }
  if (!Util.isUnset(request.ipamScopeName)) {
    query['IpamScopeName'] = request.ipamScopeName;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateIpamScope',
    version = '2023-02-28',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request UpdateIpamScopeRequest
 * @return UpdateIpamScopeResponse
 */
async function updateIpamScope(request: UpdateIpamScopeRequest): UpdateIpamScopeResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateIpamScopeWithOptions(request, runtime);
}

